<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE HTML>
<html lang="zh">
<head>
    <base href="${pageContext.request.contextPath}/"/>
    <title>援藏平台后台系统</title>
    <link href="assets/css/dpl-min.css" rel="stylesheet" type="text/css"/>
    <link href="assets/css/bui-min.css" rel="stylesheet" type="text/css"/>
    <link href="assets/css/main-min.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div class="header">
    <div class="dl-title">
        <!--<img src="/chinapost/Public/assets/img/top.png">-->
    </div>
    <div class="dl-log"><c:if test="${userId != null}">欢迎您，<span class="dl-log-user">${username}</span>
        <a id="logout" title="退出系统" style="cursor: pointer" class="dl-log-quit">[退出]</a></c:if>
        <a id="main-button" href="/main" title="回到首页" style="cursor: pointer" class="dl-log-quit">[首页]</a>
    </div>
</div>
<div class="content">
    <div class="dl-main-nav">
        <div class="dl-inform">
            <div class="dl-inform-title"><s class="dl-inform-icon dl-up"></s></div>
        </div>
        <ul id="J_Nav" class="nav-list ks-clear">
            <li class="nav-item dl-selected">
                <div class="nav-item-inner nav-home">系统管理</div>
            </li>
            <li class="nav-item dl-selected">
                <div class="nav-item-inner nav-order">业务管理</div>
            </li>

        </ul>
    </div>
    <ul id="J_NavContent" class="dl-tab-conten">

    </ul>
</div>
<script type="text/javascript" src="assets/js/jquery-1.8.1.min.js"></script>
<script type="text/javascript" src="assets/js/bui-min.js"></script>
<script type="text/javascript" src="assets/js/common/main-min.js"></script>
<script type="text/javascript" src="assets/js/config-min.js"></script>
<script>
    BUI.use('common/main', function () {
        var menu2 = [];
        $.ajax({
            url: "/user/getMenu?userId=" +${userId},
            type: "post",
            async: true,
            // data: param,
            success: function (res) {
                var rr = JSON.parse(res)

                var config = [
                    {
                        id: '1', menu: rr
                    }
                ];
                new PageUtil.MainPage({
                    modulesConfig: config
                });
                menu2 = [].concat(rr)
            }, error: function (e) {
                alert(e)
            }
        });
    });

    $("#logout").click(function () {
        if (confirm("你确定要退出吗？")) {
            $.ajax({
                url: "/user/logout",
                type: "post",
                async: true,
                data: null,
                success: function () {
                    window.location.href = "/main";
                }
            });
        } else {
            //can not delete
        }
    });
</script>
<div style="text-align:center;">
    <p>©Copyright<a href="http://www.tedu.cn/" target="_blank">达内科技</a></p>
</div>
</body>
</html>